<!doctype html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Jay'实验室 文档中心 - {$book.title}</title>
        <link rel="stylesheet" href="__CSS__/layout.css">
        <link rel="stylesheet" href="__CSS__/style.css">
        <link rel="stylesheet" href="__JS__/thinktree/skin/default/style.css">
    </head>
    <body>
        <header class="layout">
            <h1>{$book.title}</h1>
        </header>
        <aside class="layout">
            <nav data-name="{$chapter.title}">
                {:show_tree($tree, 'tree')}
            </nav>
        </aside>
        <section class="layout">
            <article class="book">
                <header>
                    <h1>{$chapter.title}</h1>
                    <div class="discription">{$chapter.discription}</div>
                </header>
                <section class="content" id="content">
                    {$chapter.content|Markdown}
                </section>
                <footer>
                    {:hooks('documentDetailAfter',array())}
                </footer>
            </article>
            <div id="editor" class="editor">
            </div>
        </section>
        <footer class="layout">
            <p class="copyright">&copy;2013 Jay's实验室 文档中心 由 ThinkPHP 强力驱动</p>
        </footer>

        <script type="text/javascript" src="__JS__/jquery.js"></script>
        <script type="text/javascript" src="__JS__/thinktree/jquery.thinktree.js"></script>
        <script type="text/javascript">
            +function($) {
                /**
                 * 初始化目录树
                 * 目录树创建成功或选中当前目录节点
                 */
                var $nav = $("nav").thinktree();
                var name = $nav.data("name");
                var $item = name ? $nav.find("li[data-name=" + name + "]") : $nav.find("li:first");
                $nav.data("ThinkTree").active($item);
            }(jQuery);
        </script>
    </body>
</html>
